import logging
import qrcode
import base64
from io import BytesIO
from odoo import api, fields, models
from PIL import Image,ImageFont,ImageDraw
from odoo import tools, _
from odoo.exceptions import ValidationError, AccessError
from odoo.modules.module import get_module_resource
import json
_logger = logging.getLogger(__name__)


class PosUser(models.Model):
    _name = 'pos.user'
    _description = 'pos.user'

    #昵称
    name = fields.Char(string='Nickname',required=True)
    # 用户名
    username = fields.Char(string='Username',required=True)

    password = fields.Char(string='Password',required=True)
    imei = fields.Char(string='IMEI')
    phone = fields.Char(string='Phone')

    _sql_constraints = [
        ('imei_uniq', 'UNIQUE (imei)', 'date duplication'),
        ('username_uniq', 'UNIQUE (username)', 'date duplication')
    ]

